*** Settings ***
Library           FN

*** Test Cases ***
4.1 用户存在一个未生效的后付费和一个未生效的后付费，通过接口查询用户当前生效的授权模式，返回为空
    Init Step
    ${interface}    Set Variable    cn.com.servyou.business.oec.facade.info.EmpowerInfoFacade
    ${method}    Set Variable    queryInforceEmpowerOrderPeriod
    ${customerId}    Get UUID
    ${serviceCode}    Set Variable    ${PTS_INFO['serviceCode']}
    ${serviceType}    Set Variable    ${PTS_INFO['serviceType']}
    ${power_sql_1}    Create Oec Power    not-power    ${customerId}    1    1
    ${power_sql_2}    Create Oec Power    not-power    ${customerId}    2    1
    ${redis_key}    Get Oec Power Inforce Key    ${customerId}    ${serviceCode}    ${serviceType}
    Redis Step
    Connect To Redis    ${OEC_REDIS_URL}    ${OEC_REDIS_ALIAS}
    Delete Key From Redis    ${OEC_REDIS_ALIAS}    ${redis_key}
    Mysql Step
    Connect To Database    pymysql    ${OEC_DB_URL}    ${OEC_DB_ALIAS}
    Execute Sql String    ${OEC_DB_ALIAS}    DELETE from oec_consumable_empower_info where customer_id = '${customer_id}'    ${DB_OP_TYPE_DELETE}
    Execute Sql String    ${OEC_DB_ALIAS}    ${power_sql_1}    ${DB_OP_TYPE_INSERT}
    Execute Sql String    ${OEC_DB_ALIAS}    ${power_sql_2}    ${DB_OP_TYPE_INSERT}
    Doing Step
    ${post_data}    Create Dictionary
    Set To Dictionary    ${post_data}    customerId    ${customerId}
    Set To Dictionary    ${post_data}    serviceCode    ${serviceCode}
    Set To Dictionary    ${post_data}    serviceType    ${serviceType}
    ${resp}    Dubbo Invoke    ${OEC_ZK_ADDR}    ${interface}    ${method}    ${post_data}
    Check Step
    Equal As String    ${resp['entity']['effectiveEndDate']}    ${None}
    Equal As String    ${resp['entity']['chargeMode']}    ${None}
    Equal As String    ${resp['entity']['effectiveStartDate']}    ${None}
    Redis Key Should Be Exist    ${OEC_REDIS_ALIAS}    ${redis_key}    30
    ${redis_key_value}    Get Redis Key Value    ${OEC_REDIS_ALIAS}    ${redis_key}
    Equal As String    ${redis_key_value}    ${None}
    Validate Schema    ${resp}
    Close Step
    Close Database    ${OEC_DB_ALIAS}
    Close Redis    ${OEC_REDIS_ALIAS}

4.2 用户存在一个未生效的后付费和一个生效中的后付费，通过接口查询用户当前生效的授权模式，返回为空
    Init Step
    ${interface}    Set Variable    cn.com.servyou.business.oec.facade.info.EmpowerInfoFacade
    ${method}    Set Variable    queryInforceEmpowerOrderPeriod
    ${customerId}    Get UUID
    ${serviceCode}    Set Variable    ${PTS_INFO['serviceCode']}
    ${serviceType}    Set Variable    ${PTS_INFO['serviceType']}
    ${power_sql_1}    Create Oec Power    not-power    ${customerId}    1    1
    ${power_sql_2}    Create Oec Power    powering    ${customerId}    2    1
    ${redis_key}    Get Oec Power Inforce Key    ${customerId}    ${serviceCode}    ${serviceType}
    Redis Step
    Connect To Redis    ${OEC_REDIS_URL}    ${OEC_REDIS_ALIAS}
    Delete Key From Redis    ${OEC_REDIS_ALIAS}    ${redis_key}
    Mysql Step
    Connect To Database    pymysql    ${OEC_DB_URL}    ${OEC_DB_ALIAS}
    Execute Sql String    ${OEC_DB_ALIAS}    DELETE from oec_consumable_empower_info where customer_id = '${customer_id}'    ${DB_OP_TYPE_DELETE}
    Execute Sql String    ${OEC_DB_ALIAS}    ${power_sql_1}    ${DB_OP_TYPE_INSERT}
    Execute Sql String    ${OEC_DB_ALIAS}    ${power_sql_2}    ${DB_OP_TYPE_INSERT}
    Doing Step
    ${post_data}    Create Dictionary
    Set To Dictionary    ${post_data}    customerId    ${customerId}
    Set To Dictionary    ${post_data}    serviceCode    ${serviceCode}
    Set To Dictionary    ${post_data}    serviceType    ${serviceType}
    ${resp}    Dubbo Invoke    ${OEC_ZK_ADDR}    ${interface}    ${method}    ${post_data}
    Check Step
    Equal As String    ${resp['entity']['effectiveEndDate']}    ${None}
    Equal As String    ${resp['entity']['chargeMode']}    ${None}
    Equal As String    ${resp['entity']['effectiveStartDate']}    ${None}
    Redis Key Should Be Exist    ${OEC_REDIS_ALIAS}    ${redis_key}    30
    ${redis_key_value}    Get Redis Key Value    ${OEC_REDIS_ALIAS}    ${redis_key}
    Equal As String    ${redis_key_value}    ${None}
    Validate Schema    ${resp}
    Close Step
    Close Database    ${OEC_DB_ALIAS}
    Close Redis    ${OEC_REDIS_ALIAS}

4.3 用户存在一个未生效的后付费和一个已失效的后付费，通过接口查询用户当前生效的授权模式，返回为空
    Init Step
    ${interface}    Set Variable    cn.com.servyou.business.oec.facade.info.EmpowerInfoFacade
    ${method}    Set Variable    queryInforceEmpowerOrderPeriod
    ${customerId}    Get UUID
    ${serviceCode}    Set Variable    ${PTS_INFO['serviceCode']}
    ${serviceType}    Set Variable    ${PTS_INFO['serviceType']}
    ${power_sql_1}    Create Oec Power    not-power    ${customerId}    1    1
    ${power_sql_2}    Create Oec Power    powered    ${customerId}    2    1
    ${redis_key}    Get Oec Power Inforce Key    ${customerId}    ${serviceCode}    ${serviceType}
    Redis Step
    Connect To Redis    ${OEC_REDIS_URL}    ${OEC_REDIS_ALIAS}
    Delete Key From Redis    ${OEC_REDIS_ALIAS}    ${redis_key}
    Mysql Step
    Connect To Database    pymysql    ${OEC_DB_URL}    ${OEC_DB_ALIAS}
    Execute Sql String    ${OEC_DB_ALIAS}    DELETE from oec_consumable_empower_info where customer_id = '${customer_id}'    ${DB_OP_TYPE_DELETE}
    Execute Sql String    ${OEC_DB_ALIAS}    ${power_sql_1}    ${DB_OP_TYPE_INSERT}
    Execute Sql String    ${OEC_DB_ALIAS}    ${power_sql_2}    ${DB_OP_TYPE_INSERT}
    Doing Step
    ${post_data}    Create Dictionary
    Set To Dictionary    ${post_data}    customerId    ${customerId}
    Set To Dictionary    ${post_data}    serviceCode    ${serviceCode}
    Set To Dictionary    ${post_data}    serviceType    ${serviceType}
    ${resp}    Dubbo Invoke    ${OEC_ZK_ADDR}    ${interface}    ${method}    ${post_data}
    Check Step
    Equal As String    ${resp['entity']['effectiveEndDate']}    ${None}
    Equal As String    ${resp['entity']['chargeMode']}    ${None}
    Equal As String    ${resp['entity']['effectiveStartDate']}    ${None}
    Redis Key Should Be Exist    ${OEC_REDIS_ALIAS}    ${redis_key}    30
    ${redis_key_value}    Get Redis Key Value    ${OEC_REDIS_ALIAS}    ${redis_key}
    Equal As String    ${redis_key_value}    ${None}
    Validate Schema    ${resp}
    Close Step
    Close Database    ${OEC_DB_ALIAS}
    Close Redis    ${OEC_REDIS_ALIAS}

4.4 用户存在一个生效中的后付费和一个未生效的后付费，通过接口查询用户当前生效的授权模式，返回预付费起止时间
    Init Step
    ${interface}    Set Variable    cn.com.servyou.business.oec.facade.info.EmpowerInfoFacade
    ${method}    Set Variable    queryInforceEmpowerOrderPeriod
    ${customerId}    Get UUID
    ${serviceCode}    Set Variable    ${PTS_INFO['serviceCode']}
    ${serviceType}    Set Variable    ${PTS_INFO['serviceType']}
    ${power_sql_1}    Create Oec Power    powering    ${customerId}    1    1
    ${power_sql_2}    Create Oec Power    not-power    ${customerId}    2    1
    ${redis_key}    Get Oec Power Inforce Key    ${customerId}    ${serviceCode}    ${serviceType}
    Redis Step
    Connect To Redis    ${OEC_REDIS_URL}    ${OEC_REDIS_ALIAS}
    Delete Key From Redis    ${OEC_REDIS_ALIAS}    ${redis_key}
    Mysql Step
    Connect To Database    pymysql    ${OEC_DB_URL}    ${OEC_DB_ALIAS}
    Execute Sql String    ${OEC_DB_ALIAS}    DELETE from oec_consumable_empower_info where customer_id = '${customer_id}'    ${DB_OP_TYPE_DELETE}
    Execute Sql String    ${OEC_DB_ALIAS}    ${power_sql_1}    ${DB_OP_TYPE_INSERT}
    Execute Sql String    ${OEC_DB_ALIAS}    ${power_sql_2}    ${DB_OP_TYPE_INSERT}
    ${effectiveStartDate}    Query    ${OEC_DB_ALIAS}    select DATE_FORMAT( date_add(curdate()-day(curdate())+1,interval -1 month), '%Y-%m-%d')    ${DB_QUERY_ALIAS}
    ${effectiveEndDate}    Query    ${OEC_DB_ALIAS}    select DATE_FORMAT( date_add(curdate()-day(curdate())+1,interval +1 month), '%Y-%m-%d')    ${DB_QUERY_ALIAS}
    Doing Step
    ${post_data}    Create Dictionary
    Set To Dictionary    ${post_data}    customerId    ${customerId}
    Set To Dictionary    ${post_data}    serviceCode    ${serviceCode}
    Set To Dictionary    ${post_data}    serviceType    ${serviceType}
    ${resp}    Dubbo Invoke    ${OEC_ZK_ADDR}    ${interface}    ${method}    ${post_data}
    Check Step
    Equal As String    ${resp['entity']['effectiveStartDate']}    ${effectiveStartDate[0]['result']}
    Equal As String    ${resp['entity']['effectiveEndDate']}    ${effectiveEndDate[0]['result']}
    Equal As String    ${resp['entity']['chargeMode']}    ${OEC_POWER_ORDINARY}
    Redis Key Should Be Exist    ${OEC_REDIS_ALIAS}    ${redis_key}    30
    ${redis_key_value}    Get Redis Key Value    ${OEC_REDIS_ALIAS}    ${redis_key}
    Equal As Json String    ${redis_key_value}    ${resp['entity']}
    ${check_power_sql}    Check Oec Power Sql    ${customerId}    ${resp['entity']}
    Row Count Is Equal To X    ${OEC_DB_ALIAS}    ${check_power_sql}    1
    Validate Schema    ${resp}
    Close Step
    Close Database    ${OEC_DB_ALIAS}
    Close Redis    ${OEC_REDIS_ALIAS}

4.5 用户存在一个生效中的后付费和一个生效中的后付费，通过接口查询用户当前生效的授权模式，返回预付费起止时间
    Init Step
    ${interface}    Set Variable    cn.com.servyou.business.oec.facade.info.EmpowerInfoFacade
    ${method}    Set Variable    queryInforceEmpowerOrderPeriod
    ${customerId}    Get UUID
    ${serviceCode}    Set Variable    ${PTS_INFO['serviceCode']}
    ${serviceType}    Set Variable    ${PTS_INFO['serviceType']}
    ${power_sql_1}    Create Oec Power    powering    ${customerId}    1    1
    ${power_sql_2}    Create Oec Power    powering    ${customerId}    2    1
    ${redis_key}    Get Oec Power Inforce Key    ${customerId}    ${serviceCode}    ${serviceType}
    Redis Step
    Connect To Redis    ${OEC_REDIS_URL}    ${OEC_REDIS_ALIAS}
    Delete Key From Redis    ${OEC_REDIS_ALIAS}    ${redis_key}
    Mysql Step
    Connect To Database    pymysql    ${OEC_DB_URL}    ${OEC_DB_ALIAS}
    Execute Sql String    ${OEC_DB_ALIAS}    DELETE from oec_consumable_empower_info where customer_id = '${customer_id}'    ${DB_OP_TYPE_DELETE}
    Execute Sql String    ${OEC_DB_ALIAS}    ${power_sql_1}    ${DB_OP_TYPE_INSERT}
    Execute Sql String    ${OEC_DB_ALIAS}    ${power_sql_2}    ${DB_OP_TYPE_INSERT}
    ${effectiveStartDate}    Query    ${OEC_DB_ALIAS}    select DATE_FORMAT( date_add(curdate()-day(curdate())+1,interval -1 month), '%Y-%m-%d')    ${DB_QUERY_ALIAS}
    ${effectiveEndDate}    Query    ${OEC_DB_ALIAS}    select DATE_FORMAT( date_add(curdate()-day(curdate())+1,interval +1 month), '%Y-%m-%d')    ${DB_QUERY_ALIAS}
    Doing Step
    ${post_data}    Create Dictionary
    Set To Dictionary    ${post_data}    customerId    ${customerId}
    Set To Dictionary    ${post_data}    serviceCode    ${serviceCode}
    Set To Dictionary    ${post_data}    serviceType    ${serviceType}
    ${resp}    Dubbo Invoke    ${OEC_ZK_ADDR}    ${interface}    ${method}    ${post_data}
    Check Step
    Equal As String    ${resp['entity']['effectiveStartDate']}    ${effectiveStartDate[0]['result']}
    Equal As String    ${resp['entity']['effectiveEndDate']}    ${effectiveEndDate[0]['result']}
    Equal As String    ${resp['entity']['chargeMode']}    ${OEC_POWER_ORDINARY}
    Redis Key Should Be Exist    ${OEC_REDIS_ALIAS}    ${redis_key}    30
    ${redis_key_value}    Get Redis Key Value    ${OEC_REDIS_ALIAS}    ${redis_key}
    Equal As Json String    ${redis_key_value}    ${resp['entity']}
    ${check_power_sql}    Check Oec Power Sql    ${customerId}    ${resp['entity']}
    Row Count Is Equal To X    ${OEC_DB_ALIAS}    ${check_power_sql}    1
    Validate Schema    ${resp}
    Close Step
    Close Database    ${OEC_DB_ALIAS}
    Close Redis    ${OEC_REDIS_ALIAS}

4.6 用户存在一个生效中的后付费和一个已失效的后付费，通过接口查询用户当前生效的授权模式，返回预付费起止时间
    Init Step
    ${interface}    Set Variable    cn.com.servyou.business.oec.facade.info.EmpowerInfoFacade
    ${method}    Set Variable    queryInforceEmpowerOrderPeriod
    ${customerId}    Get UUID
    ${serviceCode}    Set Variable    ${PTS_INFO['serviceCode']}
    ${serviceType}    Set Variable    ${PTS_INFO['serviceType']}
    ${power_sql_1}    Create Oec Power    powering    ${customerId}    1    1
    ${power_sql_2}    Create Oec Power    powered    ${customerId}    2    1
    ${redis_key}    Get Oec Power Inforce Key    ${customerId}    ${serviceCode}    ${serviceType}
    Redis Step
    Connect To Redis    ${OEC_REDIS_URL}    ${OEC_REDIS_ALIAS}
    Delete Key From Redis    ${OEC_REDIS_ALIAS}    ${redis_key}
    Mysql Step
    Connect To Database    pymysql    ${OEC_DB_URL}    ${OEC_DB_ALIAS}
    Execute Sql String    ${OEC_DB_ALIAS}    DELETE from oec_consumable_empower_info where customer_id = '${customer_id}'    ${DB_OP_TYPE_DELETE}
    Execute Sql String    ${OEC_DB_ALIAS}    ${power_sql_1}    ${DB_OP_TYPE_INSERT}
    Execute Sql String    ${OEC_DB_ALIAS}    ${power_sql_2}    ${DB_OP_TYPE_INSERT}
    ${effectiveStartDate}    Query    ${OEC_DB_ALIAS}    select DATE_FORMAT( date_add(curdate()-day(curdate())+1,interval -1 month), '%Y-%m-%d')    ${DB_QUERY_ALIAS}
    ${effectiveEndDate}    Query    ${OEC_DB_ALIAS}    select DATE_FORMAT( date_add(curdate()-day(curdate())+1,interval +1 month), '%Y-%m-%d')    ${DB_QUERY_ALIAS}
    Doing Step
    ${post_data}    Create Dictionary
    Set To Dictionary    ${post_data}    customerId    ${customerId}
    Set To Dictionary    ${post_data}    serviceCode    ${serviceCode}
    Set To Dictionary    ${post_data}    serviceType    ${serviceType}
    ${resp}    Dubbo Invoke    ${OEC_ZK_ADDR}    ${interface}    ${method}    ${post_data}
    Check Step
    Equal As String    ${resp['entity']['effectiveStartDate']}    ${effectiveStartDate[0]['result']}
    Equal As String    ${resp['entity']['effectiveEndDate']}    ${effectiveEndDate[0]['result']}
    Equal As String    ${resp['entity']['chargeMode']}    ${OEC_POWER_ORDINARY}
    Redis Key Should Be Exist    ${OEC_REDIS_ALIAS}    ${redis_key}    30
    ${redis_key_value}    Get Redis Key Value    ${OEC_REDIS_ALIAS}    ${redis_key}
    Equal As Json String    ${redis_key_value}    ${resp['entity']}
    ${check_power_sql}    Check Oec Power Sql    ${customerId}    ${resp['entity']}
    Row Count Is Equal To X    ${OEC_DB_ALIAS}    ${check_power_sql}    1
    Validate Schema    ${resp}
    Close Step
    Close Database    ${OEC_DB_ALIAS}
    Close Redis    ${OEC_REDIS_ALIAS}

4.7 用户存在一个已失效的后付费和一个未生效的后付费，通过接口查询用户当前生效的授权模式，返回为空
    Init Step
    ${interface}    Set Variable    cn.com.servyou.business.oec.facade.info.EmpowerInfoFacade
    ${method}    Set Variable    queryInforceEmpowerOrderPeriod
    ${customerId}    Get UUID
    ${serviceCode}    Set Variable    ${PTS_INFO['serviceCode']}
    ${serviceType}    Set Variable    ${PTS_INFO['serviceType']}
    ${power_sql_1}    Create Oec Power    powered    ${customerId}    1    1
    ${power_sql_2}    Create Oec Power    not-power    ${customerId}    2    1
    ${redis_key}    Get Oec Power Inforce Key    ${customerId}    ${serviceCode}    ${serviceType}
    Redis Step
    Connect To Redis    ${OEC_REDIS_URL}    ${OEC_REDIS_ALIAS}
    Delete Key From Redis    ${OEC_REDIS_ALIAS}    ${redis_key}
    Mysql Step
    Connect To Database    pymysql    ${OEC_DB_URL}    ${OEC_DB_ALIAS}
    Execute Sql String    ${OEC_DB_ALIAS}    DELETE from oec_consumable_empower_info where customer_id = '${customer_id}'    ${DB_OP_TYPE_DELETE}
    Execute Sql String    ${OEC_DB_ALIAS}    ${power_sql_1}    ${DB_OP_TYPE_INSERT}
    Execute Sql String    ${OEC_DB_ALIAS}    ${power_sql_2}    ${DB_OP_TYPE_INSERT}
    Doing Step
    ${post_data}    Create Dictionary
    Set To Dictionary    ${post_data}    customerId    ${customerId}
    Set To Dictionary    ${post_data}    serviceCode    ${serviceCode}
    Set To Dictionary    ${post_data}    serviceType    ${serviceType}
    ${resp}    Dubbo Invoke    ${OEC_ZK_ADDR}    ${interface}    ${method}    ${post_data}
    Check Step
    Equal As String    ${resp['entity']['effectiveEndDate']}    ${None}
    Equal As String    ${resp['entity']['chargeMode']}    ${None}
    Equal As String    ${resp['entity']['effectiveStartDate']}    ${None}
    Redis Key Should Be Exist    ${OEC_REDIS_ALIAS}    ${redis_key}    30
    ${redis_key_value}    Get Redis Key Value    ${OEC_REDIS_ALIAS}    ${redis_key}
    Equal As String    ${redis_key_value}    ${None}
    Validate Schema    ${resp}
    Close Step
    Close Database    ${OEC_DB_ALIAS}
    Close Redis    ${OEC_REDIS_ALIAS}

4.8 用户存在一个已失效的后付费和一个生效中的后付费，通过接口查询用户当前生效的授权模式，返回为空
    Init Step
    ${interface}    Set Variable    cn.com.servyou.business.oec.facade.info.EmpowerInfoFacade
    ${method}    Set Variable    queryInforceEmpowerOrderPeriod
    ${customerId}    Get UUID
    ${serviceCode}    Set Variable    ${PTS_INFO['serviceCode']}
    ${serviceType}    Set Variable    ${PTS_INFO['serviceType']}
    ${power_sql_1}    Create Oec Power    powered    ${customerId}    1    1
    ${power_sql_2}    Create Oec Power    powering    ${customerId}    2    1
    ${redis_key}    Get Oec Power Inforce Key    ${customerId}    ${serviceCode}    ${serviceType}
    Redis Step
    Connect To Redis    ${OEC_REDIS_URL}    ${OEC_REDIS_ALIAS}
    Delete Key From Redis    ${OEC_REDIS_ALIAS}    ${redis_key}
    Mysql Step
    Connect To Database    pymysql    ${OEC_DB_URL}    ${OEC_DB_ALIAS}
    Execute Sql String    ${OEC_DB_ALIAS}    DELETE from oec_consumable_empower_info where customer_id = '${customer_id}'    ${DB_OP_TYPE_DELETE}
    Execute Sql String    ${OEC_DB_ALIAS}    ${power_sql_1}    ${DB_OP_TYPE_INSERT}
    Execute Sql String    ${OEC_DB_ALIAS}    ${power_sql_2}    ${DB_OP_TYPE_INSERT}
    Doing Step
    ${post_data}    Create Dictionary
    Set To Dictionary    ${post_data}    customerId    ${customerId}
    Set To Dictionary    ${post_data}    serviceCode    ${serviceCode}
    Set To Dictionary    ${post_data}    serviceType    ${serviceType}
    ${resp}    Dubbo Invoke    ${OEC_ZK_ADDR}    ${interface}    ${method}    ${post_data}
    Check Step
    Equal As String    ${resp['entity']['effectiveEndDate']}    ${None}
    Equal As String    ${resp['entity']['chargeMode']}    ${None}
    Equal As String    ${resp['entity']['effectiveStartDate']}    ${None}
    Redis Key Should Be Exist    ${OEC_REDIS_ALIAS}    ${redis_key}    30
    ${redis_key_value}    Get Redis Key Value    ${OEC_REDIS_ALIAS}    ${redis_key}
    Equal As String    ${redis_key_value}    ${None}
    Validate Schema    ${resp}
    Close Step
    Close Database    ${OEC_DB_ALIAS}
    Close Redis    ${OEC_REDIS_ALIAS}

4.9 用户存在一个已失效的后付费和一个已失效的后付费，通过接口查询用户当前生效的授权模式，返回为空
    Init Step
    ${interface}    Set Variable    cn.com.servyou.business.oec.facade.info.EmpowerInfoFacade
    ${method}    Set Variable    queryInforceEmpowerOrderPeriod
    ${customerId}    Get UUID
    ${serviceCode}    Set Variable    ${PTS_INFO['serviceCode']}
    ${serviceType}    Set Variable    ${PTS_INFO['serviceType']}
    ${power_sql_1}    Create Oec Power    powered    ${customerId}    1    1
    ${power_sql_2}    Create Oec Power    powered    ${customerId}    2    1
    ${redis_key}    Get Oec Power Inforce Key    ${customerId}    ${serviceCode}    ${serviceType}
    Redis Step
    Connect To Redis    ${OEC_REDIS_URL}    ${OEC_REDIS_ALIAS}
    Delete Key From Redis    ${OEC_REDIS_ALIAS}    ${redis_key}
    Mysql Step
    Connect To Database    pymysql    ${OEC_DB_URL}    ${OEC_DB_ALIAS}
    Execute Sql String    ${OEC_DB_ALIAS}    DELETE from oec_consumable_empower_info where customer_id = '${customer_id}'    ${DB_OP_TYPE_DELETE}
    Execute Sql String    ${OEC_DB_ALIAS}    ${power_sql_1}    ${DB_OP_TYPE_INSERT}
    Execute Sql String    ${OEC_DB_ALIAS}    ${power_sql_2}    ${DB_OP_TYPE_INSERT}
    Doing Step
    ${post_data}    Create Dictionary
    Set To Dictionary    ${post_data}    customerId    ${customerId}
    Set To Dictionary    ${post_data}    serviceCode    ${serviceCode}
    Set To Dictionary    ${post_data}    serviceType    ${serviceType}
    ${resp}    Dubbo Invoke    ${OEC_ZK_ADDR}    ${interface}    ${method}    ${post_data}
    Check Step
    Equal As String    ${resp['entity']['effectiveEndDate']}    ${None}
    Equal As String    ${resp['entity']['chargeMode']}    ${None}
    Equal As String    ${resp['entity']['effectiveStartDate']}    ${None}
    Redis Key Should Be Exist    ${OEC_REDIS_ALIAS}    ${redis_key}    30
    ${redis_key_value}    Get Redis Key Value    ${OEC_REDIS_ALIAS}    ${redis_key}
    Equal As String    ${redis_key_value}    ${None}
    Validate Schema    ${resp}
    Close Step
    Close Database    ${OEC_DB_ALIAS}
    Close Redis    ${OEC_REDIS_ALIAS}
